import request from '@/utils/request';

// 设备列表
export function getDeviceList(params) {
  return request({
    url: '/laiqianle/equipment/list',
    method: 'get',
    params,
  });
}

// 设备状态
export function equipmentDetail(sn) {
  return request({
    url: '/laiqianle/equipment/sn/' + sn,
    method: 'get',
  });
}

// 添加暂存
export function addDraft(data) {
  return request({
    url: `/system/draft`,
    method: 'post',
    data,
  });
}

// 修改暂存
export function editDraft(data) {
  return request({
    url: `/system/draft`,
    method: 'put',
    data,
  });
}

// 暂存列表
export function draftList(params) {
  return request({
    url: '/system/draft/finally',
    method: 'get',
    params,
  });
}

// 删除暂存
export function delDraft(id) {
  return request({
    url: '/system/draft/' + id,
    method: 'delete',
  });
}

// 暂存详情
export function draftDetail(id) {
  return request({
    url: '/system/draft/' + id,
    method: 'get',
  });
}

// 上报机构
export function reportOrg(data) {
  return request({
    url: `/laiqianle/register/up/${data}`,
    method: 'post',
  });
}

export function reportOrgOne(data) {
  return request({
    url: `/laiqianle/register/upOne/${data}`,
    method: 'post',
  });
}

// 注册
export function register(data) {
  return request({
    url: '/laiqianle/register',
    method: 'post',
    data,
  });
}

// 地址信息
export function getAreaList(params) {
  return request({
    url: '/laiqianle/address/getAllList',
    method: 'get',
    params,
  });
}

// 地址-分级-id
export function areaListByParentId(params) {
  return request({
    url: '/laiqianle/address/getSubordinateList/' + params,
    method: 'get',
  });
}

// 地址-分级-code
export function areaListByParentCode(params) {
  return request({
    url: '/laiqianle/address/getSubordinateCodeList/' + params,
    method: 'get',
  });
}

// 经营类型列表
export function businessTypeList(params) {
  return request({
    url: '/laiqianle/type/list',
    method: 'get',
    params,
  });
}

// 银行列表
export function bankList(params) {
  return request({
    url: '/laiqianle/bank/listAll',
    method: 'get',
    params,
  });
}

// 联行号
export function openbankList(params) {
  return request({
    url: '/laiqianle/no/listName',
    method: 'get',
    params,
  });
}
export function openbankListNew(params) {
  return request({
    url: 'laiqianle/no/listCity',
    method: 'get',
    params,
  });
}

// 查询来钱乐商户注册列表
export function listRegister(query) {
  return request({
    url: '/laiqianle/register/list',
    method: 'get',
    params: query,
  });
}

// 查询来钱乐商户注册详细
export function getRegister(id) {
  return request({
    url: '/laiqianle/register/' + id,
    method: 'get',
  });
}

// 新增来钱乐商户注册
export function addRegister(data) {
  return request({
    url: '/laiqianle/register',
    method: 'post',
    data: data,
  });
}

// 修改来钱乐商户注册
export function updateRegister(data) {
  return request({
    url: '/laiqianle/register',
    method: 'put',
    data: data,
  });
}

// 删除来钱乐商户注册
export function delRegister(id) {
  return request({
    url: '/laiqianle/register/' + id,
    method: 'delete',
  });
}

export function getPost(params) {
  return request({
    url: '/laiqianle/register/out/' + params,
    method: 'get',
    // params
  });
}

// 识别身份证
export function getCard(params) {
  return request({
    url: '/system/api/orc/card',
    method: 'get',
    params: params,
  });
}

// 识别营业执照
export function getBusiness(params) {
  return request({
    url: '/system/api/orc/business',
    method: 'get',
    params: params,
  });
}

// 识别银行卡
export function getBank(params) {
  return request({
    url: '/system/api/orc/bank',
    method: 'get',
    params: params,
  });
}
